import sympy as sp

# 定义符号变量
t, tau, R, L, omega, E0 = sp.symbols('t tau R L omega E0', real=True, positive=True)

# 定义被积函数
integrand = sp.exp(-(R/L)*(t - tau)) * sp.sin(omega * tau)

# 计算定积分
integral_result = sp.integrate(integrand, (tau, 0, t))

# 乘以系数 E0/L
j_t = (E0 / L) * integral_result

# 展开结果并化简
j_t_simplified = sp.expand(j_t).simplify()

# 目标表达式（题目给出的最终结果）
target = E0/(R**2 + L**2 * omega**2) * (R * sp.sin(omega*t) - omega*L * sp.cos(omega*t)) \
         + (E0 * omega * L)/(R**2 + L**2 * omega**2) * sp.exp(-(R/L)*t)

# 检查两者是否相等
verification = sp.simplify(j_t_simplified - target) == 0

print("计算得到的积分结果:")
sp.pprint(j_t_simplified)
print("\n目标表达式:")
sp.pprint(target)
print("\n验证结果是否一致:", verification)